package Offer17;

/**
 * 打印从1到最大的n位数
 */
public class Test {
    public static void main(String[] args) {
        int[] ints = new Solution().printNumbers(1);
        for (int anInt : ints) {
            System.out.println(ints[anInt]);
        }
    }
}

class Solution {
    public int[] printNumbers(int n) {
        int count = 0;
        int[] result = new int[(int) Math.pow(10,n)-1];
        for (int i = 1; i < (int) Math.pow(10,n); i++) {
            result[i-1] = i;
        }
        return  result;
    }
}
